package com.ky.client.service;

import java.util.Scanner;

public class StartService implements Service {

	Service nextService=null;
	@SuppressWarnings("resource")
	@Override
	public Service service() {
		Scanner scanner = new Scanner(System.in);
		while(true) {
			System.out.println("欢迎访问课云系统！");
			System.out.println("1.注册\n2.登录\n3.退出");
			System.out.print("请选择：");
			int choice=scanner.nextInt();
			switch (choice) {
			case 1:
				nextService=new RegisterService();
				break;
			case 2:
				nextService=new LoginService();
				break;
			case 3:
				System.out.println("退出系统！");
				break;
			default:
				System.out.println("输入非法，请重新输入！");
				continue;
			}
			break;
		}
		return nextService;
	}

}
